package com.spring_mysql_redis.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class TestUtils {
    @Autowired
    private MsgSenderFanout msgSenderFanout;
    @Async
    public void asyncList1(String message){
        for (int j = 0; j< 101; j++){
            asyncList2(message);
        }
    }

    @Async
    public void asyncList2(String message){
        for (int j = 0; j< 11; j++){
            msgSenderFanout.send(message);
        }
    }
}
